/* this class served as an implementation of "Display": "Display Something with Text String".
 * the implementation classes are the another side of Bridge. 
*/
#ifndef STRING_DISPLAY_IMPL_H
#define STRING_DISPLAY_IMPL_H

#include "DisplayImpl.h"
#include <string>
#include <iostream>

namespace ImplLayer
{
class StringDisplayImpl : public DisplayImpl
{
  private:
    std::string str;  // string to be displayed.
    unsigned int strLen; // the length of string, by byte; 

    void printLine()
    {
        std::cout << "+"; // print left corner
        for(int i = 0; i < strLen; i++)
            std::cout << "-";
        std::cout << "+" << std::endl; // print right corner
    }
  public:
    StringDisplayImpl(std::string string)
    {
        this->str = string;
        this->strLen = string.length();
    }

    void rawOpen() override;
    void rawPrint() override;
    void rawClose() override;
};
}; // namespace ImplLayer
#endif
